package com.taobao.freetest.util;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;

import com.taobao.freetest.Activator;

public class LogUtils {
	
	public static void info(String message) {
		log(IStatus.INFO, IStatus.OK, message, null);
	}

	public static void error(Throwable exception) {
		error("Unexpected Exception", exception);

	}

	public static void error(String message, Throwable exception) {
		log(IStatus.ERROR, IStatus.OK, message, exception);
	}

	private static void log(int error, int ok, String message,Throwable exception) {
		log(new Status(error, Activator.PLUGIN_ID, ok, message, exception));
	}

	private static void log(Status status) {
		Activator.getDefault().getLog().log(status);
	}

}
